#include"BinaryTree.h"

TN* create_tree(Tree_data x)
{
	TN* mid = (TN*)malloc(sizeof(TN));
   if (mid == NULL)
	{
		perror("malloc fail");
		exit(1);
	}
	mid->data = x;
	mid->left = mid->right = NULL;
	return mid;
}

void test()
{
	TN* A=create_tree('A');
	TN* B=create_tree('B');
	TN* C=create_tree('C');
	TN* D=create_tree('D');
	TN* E=create_tree('E');
	TN* F=create_tree('F');
	TN* G=create_tree('G');

	A->left = B;
	A->right = C;
	B->left = D;
	B->right = E;
	C->left = F;
	C->right = G;

	//Preorder_Traversal(A);
	//printf("\n");
	//Inorder_Traversal(A);
	//printf("\n");
	//Postorder_Traversal(A);

	//int size = 0;
	//printf("%d\n", Tree_size1(A,&size));

	printf("%d\n", Tree_S_size(A));
	printf("%d\n", Tree_deep(A));
	printf("%d\n", Tree_The_K_deep_num(A, 3));
	printf("%d\n", Tree_endnum(A));
	printf("%c\n", Tree_find(A, 'D')->data);

	Tree_destroy(&A);

}

int main()
{	
	test();
	

	return 0;
}